package thoven.achievement.net.ideapluginachievement.util

import com.intellij.util.xmlb.Converter
import java.time.LocalDate
import java.time.format.DateTimeFormatter

/**
 * LocalDate的序列化转换器
 */
class LocalDateConverter : Converter<LocalDate>() {
    
    companion object {
        private val FORMATTER = DateTimeFormatter.ISO_LOCAL_DATE
    }
    
    override fun toString(value: LocalDate): String {
        return FORMATTER.format(value)
    }
    
    override fun fromString(value: String): LocalDate {
        return LocalDate.parse(value, FORMATTER)
    }
} 